//
//  GJTyLayout.m
//  GJLifeSimple
//
//  Created by MacBook on 16/6/18.
//  Copyright © 2016年 GoodJob. All rights reserved.
//

#import "GJTyLayout.h"
@implementation GJTyLayout

//collectionView需要布局是调用
//再次调用的时候,大小已经就绪
- (void)prepareLayout {

    [super prepareLayout];

    //collectionView布局
    CGSize size = self.collectionView.bounds.size;
        NSInteger count = 4;
    
    //1.定义格子的大小
    self.itemSize = CGSizeMake(80, 110);
    
    //组内间距
    CGFloat margin = 10;
    self.sectionInset = UIEdgeInsetsMake(40, margin, 50, margin);
    
    //格子最小间距
    self.minimumLineSpacing = round((size.width - count *self.itemSize.width - 2 * margin) / (count - 1));
    
    self.scrollDirection = UICollectionViewScrollDirectionVertical;
    
    //隐藏指示器
    self.collectionView.showsVerticalScrollIndicator = NO;
    self.collectionView.showsHorizontalScrollIndicator = NO;

    
    
}

@end
